#include <iostream>
#include <string>
// 包含SpireMS SDK头文件
#include <sms_core.h>


nlohmann::json callback(nlohmann::json msg)
{
    std::cout << msg["data"].get<std::string>() << std::endl;
    nlohmann::json resp = sms::def_msg("std_msgs::String");
    resp["data"] = "your request: " + msg["data"].get<std::string>() + ", we got it!";
    return resp;
}


int main(int argc, char *argv[])
{
    sms::Service svs("/service1", "std_msgs::String", "std_msgs::String", callback);
    svs.join();
    return 0;
}

